package com.it.intelligent_team.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.it.intelligent_team.manager.model.dto.meeting.MeetingQueryRequest;
import com.it.intelligent_team.manager.model.entity.Meeting;
import com.it.intelligent_team.manager.model.vo.MeetingVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 会议服务
 *
 */
public interface MeetingService extends IService<Meeting> {

    /**
     * 校验数据
     *
     * @param meeting
     * @param add 对创建的数据进行校验
     */
    void validMeeting(Meeting meeting, boolean add);

    /**
     * 获取查询条件
     *
     * @param meetingQueryRequest
     * @return
     */
    QueryWrapper<Meeting> getQueryWrapper(MeetingQueryRequest meetingQueryRequest);


    /**
     * 获取会议封装
     *
     * @param meeting
     * @param request
     * @return
     */
    MeetingVO getMeetingVO(Meeting meeting, HttpServletRequest request);

    /**
     * 分页获取会议封装
     *
     * @param meetingPage
     * @param request
     * @return
     */
    Page<MeetingVO> getMeetingVOPage(Page<Meeting> meetingPage, HttpServletRequest request);

    /**
    * 批量插入数据
    *
    * @param meetingList 数据列表
    * @return 是否成功
    */
    boolean saveBatch(List<Meeting> meetingList);

    /**
    * 批量查询数据
    *
    * @param ids ID数组
    * @return 数据列表
    */
    List<Meeting> listByIds(Long[] ids);

    /**
    * 批量删除数据
    *
    * @param ids ID数组
    * @return 是否成功
    */
    boolean removeByIds(Long[] ids);
}
